/**
 * 
 */
package edu.towson.cosc603.coffeemaker;

import static org.junit.Assert.*;
import junit.framework.TestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * @author Poornima
 *
 */
public class InventoryTest extends TestCase{

	private Inventory inventory;
	private Recipe recipeCoffee;
	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		
		inventory = new Inventory();
		recipeCoffee = new Recipe();
		recipeCoffee.setName("Coffee");
		recipeCoffee.setPrice(70);
		recipeCoffee.setAmtCoffee(6);
		recipeCoffee.setAmtMilk(3);
		recipeCoffee.setAmtSugar(3);
		recipeCoffee.setAmtChocolate(3);
		
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getChocolate()}.
	 */
	@Test
	public void testGetChocolate() {
		inventory.setChocolate(50);
		assertEquals(50, inventory.getChocolate());
		
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getChocolate()}.
	 */
	@Test
	public void testGetChocolate2() {
		inventory.setChocolate(-50);
		assertEquals(0, inventory.getChocolate());
		
	}

	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getCoffee()}.
	 */
	@Test
	public void testGetCoffee() {
		inventory.setCoffee(25);
		assertEquals(25, inventory.getCoffee());
		
	}


	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getCoffee()}.
	 */
	@Test
	public void testGetCoffee2() {
		inventory.setCoffee(-25);
		assertEquals(0, inventory.getCoffee());
		
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getMilk()}.
	 */
	@Test
	public void testGetMilk() {
		inventory.setMilk(20);
		assertEquals(20, inventory.getMilk());
		
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getMilk()}.
	 */
	@Test
	public void testGetMilk2() {
		inventory.setMilk(-20);
		assertEquals(0, inventory.getMilk());
		
	}

	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getSugar()}.
	 */
	@Test
	public void testGetSugar() {
		
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients() {
		inventory.setCoffee(1);
		inventory.setMilk(1);
		inventory.setSugar(1);
		inventory.setChocolate(1);
		
		
		assertFalse(inventory.enoughIngredients(recipeCoffee));
		
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients2() {
		inventory.setCoffee(1);
		inventory.setMilk(4);
		inventory.setSugar(5);
		inventory.setChocolate(5);
		
		
		assertFalse(inventory.enoughIngredients(recipeCoffee));
		
	}
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients3() {
		inventory.setCoffee(7);
		inventory.setMilk(2);
		inventory.setSugar(5);
		inventory.setChocolate(5);
		
		
		assertFalse(inventory.enoughIngredients(recipeCoffee));
		
	}
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients4() {
		inventory.setCoffee(7);
		inventory.setMilk(4);
		inventory.setSugar(2);
		inventory.setChocolate(5);
		
		assertFalse(inventory.enoughIngredients(recipeCoffee));
		
	}
	

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients5() {
		inventory.setCoffee(7);
		inventory.setMilk(4);
		inventory.setSugar(5);
		inventory.setChocolate(2);
		
		assertFalse(inventory.enoughIngredients(recipeCoffee));
		
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients6() {
		inventory.setCoffee(7);
		inventory.setMilk(4);
		inventory.setSugar(5);
		inventory.setChocolate(4);
		
		assertTrue(inventory.enoughIngredients(recipeCoffee));
	}
	
	
	
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#toString()}.
	 */
	@Test
	public void testtoString() {
	
		
		inventory.setCoffee(10);
		inventory.setMilk(10);
		inventory.setSugar(10);
		inventory.setChocolate(10);
		
		String check = "Coffee: 10" + "\n" +
				"Milk: 10" + "\n" +
				"Sugar: 10" + "\n" +
				"Chocolate: 10" + "\n";
		
		assertEquals(check, inventory.toString());
		

	}
	}
